package com.xuzimian.globaldemo.spring.springrpc.rmi;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.xuzimian.globaldemo.spring.springrpc.RemoteServerPublisService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=SpringRmiConfig.class)
public class RMIDemo {
	    
	    @Autowired
	    @Qualifier("clientBean")
	    private RemoteServerPublisService remoteServerPublisService;


	    /**
	     * 测试客户端调用远程rmi服务
	     */
	    @Test
	    public void testClientCallRemoteRmiService() {
	    	 System.out.println(remoteServerPublisService.doSomething("RMI"));
	    }
}
